#!/usr/bin/python
# encoding=utf-8

import os
from wm.etc.config import DIRS,CLUSTER,MONITOR 

def kill_damon_proccess():
    for i in xrange(MONITOR['maxprocessing']):
        ret_text = os.popen("ps aux | grep monitor.py")
        pid_list=[]
        for line in ret_text:
            pid_list.append(line)
            cmd_list = pid_list[0].split()
        pid_num = cmd_list[1]
        print "kill -9 %s"%pid_num
        os.system("kill -9 %s"%pid_num)

if __name__=='__main__':
    kill_damon_proccess()

